/**
 * Created by Administrator on 2017/9/19 0019.
 */
import React from "react"
import {Redirect,Route} from "react-router";
export default function protectedRouted({component:Component,...rest}) {

    return < Route {...rest} render={
        (props)=> sessionStorage.getItem("user_token") ? <Component /> : <Redirect to={{
                pathname:"/login",
                state:{form:props.location.pathname}
            }
        }  />
    }/>
}